﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ef
{
    class Program
    {
        static void Main(string[] args)
        {

            using (ForgetTrafficEntities db = new ForgetTrafficEntities())
            {

                tblSysState ft =  db.tblSysState.SingleOrDefault(x => x.Code.Equals("X"));
                Console.WriteLine("Code" + ft.Description);

                tblSysState state = new tblSysState()
                                        {
                                            Id = Guid.NewGuid(),
                                            Code = "k",
                                            Description ="So teste"
                                        };

                db.tblSysState.AddObject(state);

                ft = db.tblSysState.SingleOrDefault(x => x.Code.Equals("k"));


                Console.WriteLine("Code" + ft.Description );
            }

        }
    }
}
